﻿@using Empires.Biz.Configuration;
@{
    ViewBag.Title = "create";
    Layout = "~/Views/Shared/_Main.cshtml";
}
@section head{
    <link rel="Stylesheet" type="text/css" href="/Content/css/bootstrap-datetimepicker.min.css" />
}
<div class="content">
    <div class="container">
        <div class="register">
            <div class="row">
                <div class="span12">
                    <div class="lrform" style="max-width: 600px;">
                        <h5>
                            注册我的企业</h5>
                        <div class="form">
                            <!-- Register form (not working)-->
                            <form id="firmform" action="/firm/create" method="post" class="form-horizontal">
                            <input type="hidden" name="token" />
                            <div class="control-group">
                                <label class="control-label">
                                    公司名(*)</label>
                                <div class="controls">
                                    <input type="text" class="{required:true}"
                                        id="txtCorporationName" name="CorporationName" placeholder="请输入您的其他名称" />
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    所在地区(*)</label>
                                <div class="controls">
                                    <select id="txtAreaCode" name="AreaCode"></select> -- <select id="txtLocation" name="Location"></select>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    所属行业(*)</label>
                                <div class="controls">
                                    <select id="txtIndustry" name="Industry"></select>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    简称(*)</label>
                                <div class="controls">
                                    <input type="text" class="span4 {required:true}" id="txtShortName"
                                        name="ShortName" placeholder="请输入您企业的简称" />
                                    <span class="help-block" style="color: Gray">请输入您企业的简称，简称将应用于您企业的域名，如 @SiteResource.Domain.Replace("www","myname")</span>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    站点名(*)</label>
                                <div class="controls">
                                    <input type="text" class="span4 {required:true}" id="txtSiteName"
                                        name="SiteName" placeholder="您的企业网站名" />
                                        <span class="help-block" style="color: Gray">您的网站名，您可以用企业名当您的站点名</span>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    联系电话(*)</label>
                                <div class="controls">
                                    <input type="text" class="span4 {required:true}" id="txtCopPhone"
                                        name="CopPhone" placeholder="请输入您企业的联系电话" />
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    公司地址(*)</label>
                                <div class="controls">
                                    <input type="text" class="span4 {required:true}" id="txtCopAddress"
                                        name="CopAddress" placeholder="请输入您企业的地址" />
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    联系人(*)</label>
                                <div class="controls">
                                    <input type="text" class="span4 {required:true}" id="txtCopContact"
                                        name="CopContact" placeholder="请输入您企业的联系人" />
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    企业简介(*)</label>
                                <div class="controls">
                                    <textarea rows="15" class="{required:true}" name="Description" id="txtDescription"></textarea>
                                </div>
                            </div>

                            <!-- Buttons -->
                            <div class="form-actions">
                                <!-- Buttons -->
                                <button type="submit" class="btn btn-info">
                                    提交</button>
                                <button type="reset" class="btn">
                                    重填</button>
                            </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="border">
        </div>
        @Html.Partial("~/views/shared/partial/_article.cshtml")
    </div>
</div>
@section tail
{
    <script type="text/javascript" src="/Scripts/plug.js"></script>
    <script type="text/javascript" src="/Scripts/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.metadata.js"></script>
    <script type="text/javascript">
        var control = new plug.Control();
        $(function () {
            $('#firmform').validate({
                errorClass: "help-inline",
                errorElement: "span",
                highlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').addClass('error');
                },
                unhighlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').removeClass('error');
                }
            });
            control.BuildRelationSelect('txtAreaCode', 'txtLocation', 'province');
            control.BuildSelect('txtIndustry', 'industry');
        });
    </script>
}
